import re

'''
参考简述地址:https://www.jianshu.com/p/82886d77440c
0-255
(2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2}
'(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}'
(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2}))

/^(\d{1}|[1-9]{1}\d{1}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1}|[1-9]{1}\d{1}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1}|[1-9]{1}\d{1}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1}|[1-9]{1}\d{1}|1\d\d|2[0-4]\d|25[0-5])$/
'''
pattern2 = r'((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}'

pattern = r'((2(5[0-5]|[0-4]\d))|1\d\d|\d|[1-9]\d)(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}'
pattern3 = r'([0-9]|[1-9]\d|1\d\d|2(5[0-5]|[0-4]\d))(\.([0-1]?\d{1,2}|2(5[0-5]|[0-4]\d))){3}'
str1 = "050.00.053.78"
# print(re1.search(str1))

str2 = 'vfvdfbgnwindows1.00hh'
# pattern = r'windows(?:\d)'

re1 = re.compile(pattern=pattern3)
# re1 = re.compile(pattern=pattern2)
print(re1.search(str1))
